﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using Pantry.DataAccess;
using Pantry.Entity;

namespace Pantry.Business
{
    public class FunderBus
    {
        private readonly FunderDao _funderDao;

        public FunderBus()
        {
            _funderDao = new FunderDao();
        }

        /// <summary>
        /// Insers the funder.
        /// </summary>
        /// <param name="funder">The funder.</param>
        /// <returns></returns>
        public int InserFunder(Funder funder)
        {
            return _funderDao.InsertFunder(funder);
        }

        /// <summary>
        /// Updates the funder.
        /// </summary>
        /// <param name="funder">The funder.</param>
        /// <returns></returns>
        public int UpdateFunder(Funder funder)
        {
            return _funderDao.UpdateFunder(funder);
        }

        /// <summary>
        /// Selects the funder by id.
        /// </summary>
        /// <param name="id">The id.</param>
        /// <returns></returns>
        public Funder SelectFunderById(int id)
        {
            return _funderDao.SelectFunderById(id);
        }

        /// <summary>
        /// Selects the funding source.
        /// </summary>
        /// <returns></returns>
        public DataTable SelectFundingSource()
        {
            return _funderDao.SelectFundingSource();
        }

        /// <summary>
        /// Gets the service max id.
        /// </summary>
        /// <returns></returns>
        public int GetServiceMaxId()
        {
            return _funderDao.SelectServiceMaxId();
        }
    }
}
